/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.editparts;

import java.beans.PropertyChangeEvent;

import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.swt.graphics.Image;

import edu.pku.sei.modeler.images.ImageProvider;
import edu.pku.sei.modeler.model.core.MetaPackage;
import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.modeler.model.structure.MetaShapeElement;

/**
 * @author zl
 *
 */
public class MetaPackageTreeEditPart extends MetaNamedElementTreeEditPart {
	public MetaPackageTreeEditPart(MetaShapeElement model) {
		super(model);
	}
	
	protected void handlePropertyChanged(PropertyChangeEvent event) {
    	super.handlePropertyChanged(event);
	}
	
    private MetaPackage getMetaPackage() {
		return (MetaPackage)((MetaNode)getModel()).getModelElement();
	}
    
    protected void refreshVisuals() {
    	super.refreshVisuals();
    	Image image = ImageProvider.getImage(ImageProvider.FIELD_PACKAGE_IMAGE);
    	setWidgetImage(image);
        setWidgetText(getMetaPackage().getName());
    }
	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractEditPart#addChildVisual(org.eclipse.gef.EditPart, int)
	 */
	protected void addChildVisual(EditPart child, int index) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
	 */
	protected void createEditPolicies() {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractEditPart#removeChildVisual(org.eclipse.gef.EditPart)
	 */
	protected void removeChildVisual(EditPart child) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.EditPart#getDragTracker(org.eclipse.gef.Request)
	 */
	public DragTracker getDragTracker(Request request) {
		// TODO Auto-generated method stub
		return null;
	}

}
